<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         var obj = {name : 'lisi',age : 24}
         var obj1 = {}
         for(var k in obj){
            obj1[k] = obj[k]
         }
         console.log(obj1)
         console.log(obj1 === obj )

         //obj拷贝函数
         function deepCopy(obj){
            var result = {}
            for(var k in obj){
                result[k] = obj[k]
            }
            return result
         }
         var obj = {name : 'lisi',age : 24}
        var obj2= deepCopy(obj)
        console.log(obj2)
    </script>
   
</body>
</html>